import { MockMethod } from "vite-plugin-mock"

export default [
  {
    url: "/dev-api/oauth/login",
    timeout: 2000,
    method: "post",
    response: () => {
      return {
        "status": 200,
        "msg": "登录成功",
        "data": {
          "userCode": "@cname",
          "auth_token": "@word(20)",
          "imageUrl": "@image",
        }
      }
    }
  },
  {
    url: "/dev-api/oauth/permissions",
    timeout: 2000,
    method: "get",
    response: () => {
      return {
        "status": 200,
        "msg": "获取用户权限成功",
        "data": {
          "results": {
            "userInfo": {
              "username": "@word(10)",
            },
            "buttonList": [
              "system:menu:search",
              "system:child:add",
              "system:menu:edit",
              "system:role:search",
              // "system:role:add",
              "system:role:edit",
              "system:role:delete",
              "system:role:menu",
              "system:user:search",
              "system:user:add",
              "system:user:edit",
              "system:user:delete",
              "system:user:password"
            ],
            "menuList": [
              {
                "path": '/home',
                "name": 'Home',
                "component": 'home/index.vue',
                "meta": {
                  "title": '首页',
                  "icon": 'i-fe-home',
                  "cache": false,
                  "hidden": true,
                  "isBreadcrumd": true,
                }
              },
              {
                "path": '/base',
                "name": 'Base',
                "redirect": '/base/icon',
                "meta": {
                  "title": '基础功能',
                  "icon": 'i-fe-book',
                  "cache": true,
                  "hidden": false,
                  "isBreadcrumd": true
                },
                "children": [
                  {
                    "path": '/base/icon',
                    "name": 'BaseIcon',
                    "redirect": null,
                    "component": "base/icon/index.vue",
                    "meta": {
                      "title": '图标Icon',
                      "icon": 'i-fe-instagram',
                      "cache": true,
                      "hidden": false,
                      "isBreadcrumd": true
                    },
                    "children": []
                  }
                ],
              },
              {
                "path": "/system",
                "name": "System",
                "redirect": "/system/menu",
                "meta": {
                  "title": '系统管理',
                  "icon": 'i-fe-settings',
                  "hidden": false,
                  "isBreadcrumd": true
                },
                "children": [
                  {
                    "path": '/system/menu',
                    "name": 'SystemMenu',
                    "redirect": null,
                    "component": "system/menu/index.vue",
                    "meta": {
                      "title": '菜单管理',
                      "icon": 'i-fe-grid',
                      "cache": true,
                      "hidden": false,
                      "isBreadcrumd": true
                    },
                    "children": []
                  },
                  {
                    "path": '/system/role',
                    "name": 'SystemRole',
                    "component": "system/role/index.vue",
                    "meta": {
                      "title": '角色管理',
                      "icon": 'i-fe-users',
                      "cache": true,
                      "hidden": false,
                      "isBreadcrumd": true
                    },
                    "children": []
                  },
                  {
                    "path": '/system/user',
                    "name": 'SystemUser',
                    "redirect": null,
                    "component": "system/user/index.vue",
                    "meta": {
                      "title": '用户管理',
                      "icon": 'i-fe-user',
                      "cache": true,
                      "hidden": false,
                      "isBreadcrumd": true
                    },
                    "children": []
                  },
                  {
                    "path": '/system/dept',
                    "name": 'SystemDept',
                    "redirect": null,
                    "component": "system/dept/index.vue",
                    "meta": {
                      "title": '部门管理',
                      "icon": 'i-fe-dept',
                      "cache": true,
                      "hidden": false,
                      "isBreadcrumd": true
                    },
                    "children": []
                  }
                ]
              },
            ]
          }
        }
      }
    }
  },
  {
    url: "/dev-api/oauth/logout",
    timeout: 2000,
    method: "post",
    response: () => {
      return {
        "staus": 200,
        "msg": "退出成功",
        "data": true
      }
    }
  },
] as MockMethod[]